﻿<UserControl x:Class="Dsl.Ped.Editor.Modules.ToolBarArea.ToolBarAreaView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:framework="clr-namespace:Dsl.Ped.Framework.Resources;assembly=DSLPedFramework"
             xmlns:commonConverters="clr-namespace:Dsl.Ped.Common.Converters;assembly=DSLCommon"
             xmlns:frameworkConverters="clr-namespace:Dsl.Ped.Framework.Converters;assembly=DslPedFramework" 
             mc:Ignorable="d"                     
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <commonConverters:StringFormatConverter x:Key="stringFormatConverter" />
            <frameworkConverters:ObjectToLocalizedStringConverter x:Key="objectToLocalizedStringConverter"/>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        
        <Border BorderBrush="Black"
                BorderThickness="1"
                Grid.Column="0">
            <ComboBox Background="Transparent" 
                      ItemsSource="{Binding Path=EditorResources.ViewModes}"
                      SelectedItem="{Binding Path=EditorResources.SelectedViewMode}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock FontWeight="Bold" FontStyle="Italic">
                                <TextBlock.Text>
                                    <MultiBinding
                                        ConverterParameter=" {0}: "
                                        Converter="{StaticResource stringFormatConverter}">
                                        <Binding Source="{x:Static framework:Lang.EditorMode}"/>
                                    </MultiBinding>
                                </TextBlock.Text>
                            </TextBlock>
                            <TextBlock Text="{Binding Converter={StaticResource objectToLocalizedStringConverter}}"/>
                        </StackPanel>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </Border>

        <Border BorderBrush="Black"
                BorderThickness="1"
                Grid.Column="1">
            <ComboBox Background="Transparent" 
                      ItemsSource="{Binding Path=EditorResources.ProjectionContainers}"
                      SelectedItem="{Binding Path=EditorResources.SelectedProjectionContainer}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Name}"/>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </Border>
    </Grid>
</UserControl>
